<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>个人中心</title>
<link href="bootstrapusers/css/bootstrap.css" rel="stylesheet"
	type="text/css" media="all">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="bootstrapusers/js/jquery-1.11.0.min.js"></script>
<!-- Custom Theme files -->
<link href="bootstrapusers/css/style.css" rel="stylesheet"
	type="text/css" media="all" />
<link href="bootstrapusers/css/style1.css" rel="stylesheet"
	type="text/css" media="all" />
<!-- Custom Theme files -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript">
	
	
	
	
	
	addEventListener("load", function() {
	setTimeout(hideURLbar, 0);
}, false);

function hideURLbar() {
	window.scrollTo(0, 1);
}





</script>
<!--Google Fonts-->
<link href='http://fonts.googleapis.com/css?family=Hind:400,300'
	rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Aladin'
	rel='stylesheet' type='text/css'>
<!--google fonts-->
<!-- animated-css -->
<link href="bootstrapusers/css/animate.css" rel="stylesheet"
	type="text/css" media="all">
<link href="bootstrapusers/css/bootstrap.min.css" rel="stylesheet">
<link href="bootstrapusers/font-awesome/css/font-awesome.min.css"
	rel="stylesheet" type="text/css" />
<!-- Custom styles for this template -->
<link href="bootstrapusers/css/style2.css" rel="stylesheet">
<link href="bootstrapusers/fonts/antonio-exotic/stylesheet.css"
	rel="stylesheet">
<link rel="stylesheet" href="bootstrapusers/css/lightbox.min.css">
<link href="bootstrapusers/css/responsive.css" rel="stylesheet">
<!-- ------------------------------引入layui的css和js样式------------------------------------- -->
<link rel="stylesheet" href="layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" href="layuiadmin/style/template.css" media="all">


<!-- -------------------------------------------------------------------------------------- -->
<script src="bootstrapusers/js/jquery.min.js" type="text/javascript"></script>
<!-- <script src="js/bootstrap.min.js" type="text/javascript"></script>-->
<script src="bootstrapusers/js/lightbox-plus-jquery.min.js"
	type="text/javascript"></script>
<script src="bootstrapusers/js/instafeed.min.js" type="text/javascript"></script>
<script src="bootstrapusers/js/custom.js" type="text/javascript"></script>
<script src="bootstrapusers/js/wow.min.js"></script>
<script>
	new WOW().init();
</script>
<!-- animated-css -->
<script src="bootstrapusers/js/bootstrap.min.js"></script>
</head>
<body>
	<!--header-top start here-->
	<%@ include file="header.jsp"%>
	<!--header end here-->
	<!--services strat here-->
	<div class="layui-fluid layadmin-homepage-fluid">
		<div class="layui-row layui-col-space8">
			<div class="layui-col-md2">
				<div class="layadmin-homepage-panel layadmin-homepage-shadow">
					<div class="layui-card text-center">
						<div class="layui-card-body">
							<div class="layadmin-homepage-pad-ver">
								<img class="layadmin-homepage-pad-img"
									src="layuiadmin/style/res/template/portrait.png" width="96"
									height="96">
							</div>
							<h4 class="layadmin-homepage-font">胡歌</h4>
							<p class="layadmin-homepage-min-font">中国知名演员</p>
							<div class="layadmin-homepage-pad-ver">
								<a href="javascript:;" class="layui-icon layui-icon-cellphone"></a>
								<a href="javascript:;" class="layui-icon layui-icon-vercode"></a>
								<a href="javascript:;"
									class="layui-icon layui-icon-login-wechat"></a> <a
									href="javascript:;" class="layui-icon layui-icon-login-qq"></a>
							</div>
							<button class="layui-btn layui-btn-fluid">跟随</button>
						</div>
					</div>
					<p class="layadmin-homepage-about">关于我</p>
					<ul class="layadmin-homepage-list-group">
						<li class="list-group-item"><i
							class="layui-icon layui-icon-location"></i>中国上海</li>
						<li class="list-group-item"><a href="javascript:;"
							class="color"><i class="layui-icon layui-icon-snowflake"></i><span
								style="word-wrap: break-word;">https://weibo.com/hu_ge</span></a></li>
					</ul>
					<div class="layadmin-homepage-pad-hor">
						<mdall>胡歌喜欢摄影，也喜欢写字，他视角独特，充满着奇思妙想。他有着极丰富的情感，和对生活的热情，他能点燃观众心中爱的火焰；胡歌积极、乐观、坚强，他脚踏实地地做好每一件事，真诚地对待身边每一个人</mdall>
					</div>
					<p class="layadmin-homepage-about">技能</p>
					<ul class="layadmin-homepage-list-inline">
						<a href="javascript:;" class="layui-btn layui-btn-primary">演员</a>
						<a href="javascript:;" class="layui-btn layui-btn-primary">主持人</a>
						<a href="javascript:;" class="layui-btn layui-btn-primary">摄影师</a>
						<a href="javascript:;" class="layui-btn layui-btn-primary">导演</a>
						<a href="javascript:;" class="layui-btn layui-btn-primary">公共人物</a>
					</ul>
				</div>
			</div>
			<div class="layui-col-md10">
				<div class="layui-fluid layadmin-homepage-content">

					<div
						class="layui-row layui-col-space20 layadmin-homepage-list-imgtxt">
						<div >
							<div class="grid-demo">



								<!-- 用户订单信息列表 -->
								<div class="panel-body layadmin-homepage-shadow">
									<h3>订单列表</h3>
									<div class="media wow fadeInLeft animated" data-wow-delay=".5s">
									<table class="layui-hide" id="test" lay-filter="test"></table>

	<script type="text/html" id="barDemo">
			<a class="layui-btn layui-btn-xs" lay-event="edit">订单评论</a>

		</script>
									</div>
								</div>

							</div>
	<!-- 表单编辑事件 -->
	<!-- 隐藏表单 -->
	<div id="editcomment" style="display: none">
	


		<form class="layui-form" action="" lay-filter="example" id="formordercomment">
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">订单编号</label>
					<div class="layui-input-inline">
						<input type="text" name="orderid" id="orderid"
							readonly="readonly" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">用户姓名</label>
					<div class="layui-input-inline">
						<input type="text" name="username" id="username"
							readonly="readonly" class="layui-input">
					</div>
				</div>
						<div class="layui-inline">
					<label class="layui-form-label">评论编号</label>
					<div class="layui-input-inline">
						<input type="text" name="commentid" id="commentid"
							readonly="readonly"  class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">评论内容</label>
					<div class="layui-input-inline">
						<input type="text" name="commentcontent" id="commentcontent"
							 class="layui-input">
					</div>
				</div>
	 			<div class="layui-inline">
					<label class="layui-form-label">上传图片</label>
					<div class="layui-input-inline">
						<input type="file" name="commentfile" id="commentfile"
							 class="layui-input">
					</div>
				</div> 
				
		
			
				

			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn btn-update" lay-submit="" lay-filter="demo3">提交评论</button>
				</div>
			</div>
			
			

		</form>
	</div>
	

					</div>
				
				</div>
			</div>
		</div>
	</div>
	</div>




	<!--features end here-->
	<!--footer start here-->
	<%@ include file="footer.jsp"%>
</body>
<script src="layuiadmin/layui/layui.js"></script>




<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="layuiadmin/layui/layui.js"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->

	<script>
		layui.use('table', function() {
			var table = layui.table;

			table.render({
				elem : '#test'
				//  ,url:'/test/table/demo1.json'
				,
				url : 'listOrdercomment' //模拟接口
				,
				toolbar : '#toolbarDemo',
				title : '评论列表',
				cols : [ [  {
					field : 'orderid',
					title : '订单编号',
					sort : true
				}, {
					field : 'username',
					title : '用户名',
					sort : true
				}, {
					field : 'ordertel',
					title : '预留电话',
						sort : true
				}, {
					field : 'orderstartdate',
					title : '下单时间',
						sort : true
				},  {
					field : 'orderenedate',
					title : '退房时间',
						sort : true
				}, {
					field : 'orderdate',
					title : '入住时间',
						sort : true
				}, {
					field : 'roomtype',
					title : '房间类型',
						sort : true,
						templet : function(res) {
							if (res.roomtype == 0)
								return "总统套房";
							if (res.roomtype == 1)
								return "单人间";
							if (res.roomtype == 2)
								return "双人间";
							if (res.roomtype == 3)
								return "三人间";
							if(res.roomtype == null)
								return "未选择";
						}
				}, {
					field : 'roomsalary',
					title : '费用',
						sort : true
				},  {
					field : 'commentid',
					title : '评论编号',
						sort : true
				}, 
				{
					field : 'commentcontent',
					title : '评论信息',
						sort : true
				}, {
					field : 'commentfile',
					title : '评论图片上传',
						sort : true
				}, {
					fixed : 'right',
					title : '操作',
					toolbar : '#barDemo',
					width : 150
				} ]

				],
				page : true,
				id:'testReload'
			});



			//表格数据重载，模糊查询
			var $ = layui.$, active = {
				reload : function() {
					var demoReload = $('#demoReload');

					//执行重载
					table.reload('testReload', {
						page : {
							curr : 1
						//重新从第 1 页开始
						},
						where : {
							//这里传值给servlet
							content : demoReload.val()
						}
					});
				}
			};

			$('.demoTable .layui-btn').on('click', function() {
				var type = $(this).data('type');
				active[type] ? active[type].call(this) : '';
			});

			//监听行工具事件
			table.on('tool(test)', function(obj) {
				var data = obj.data;
				if (obj.event === 'edit') {

					//给表单元素赋值
					$("#orderid").attr("value", data.orderid);
					$("#username").attr("value", data.username);
					$("#commentid").attr("value", data.commentid);
					$("#commentcontent").attr("value", data.commentcontent);
					$("#commentfile").attr("value", data.commentfile);
	
			

					

					//添加一个弹出层
					var index1 = layer.open({
						type : 1,
						content : $("#editcomment"),
						title : '修改评论信息',

					});

					layui.form.render();//这个是表单的render，用于处理单选框、按钮、多选框不能被选中的问题
				}
			});

			//ajax修改提交,  此处搭配监听行工具事件  的修改操作
			layui.form.on('submit(demo3)', function(data) {
				//这里输出看下json对象
				//console.log(JSON.stringify(data.field));
               var form=new FormData(doucument.getElementById("formordercomment"));
				$.ajax({
					'type' : 'post',
					'url' : 'updatecomment',
					'data' : form,
					'processData' : false,
					'contentTyp' : false,
				
					success : function(cm) {
						layer.msg( cm.msg, {
							time : 1000,
						}, function() {
							if (cm.msg == "修改成功") {

								layer.closeAll();
								table.reload('testReload');
								

							}
						});
					}

				});

				return false;
			});

		});
	</script>
<!-- 图片上传 js -->
<!-- <script>
/**
 * 图片上传数量及其大小等控制
 * 点击开始上传按钮(demo2)，执行上传
 * 
 */
var success=0;
var fail=0;
var imgurls="";

$(function (){
	var imgsName="";
	layui.use(['upload','layer'],function() {
		var upload = layui.upload;
		var layer=layui.layer;

		upload.render({
			elem: '#commentfile',
			url: '/upload',
			multiple: true,
			auto:false,
//			上传的单个图片大小
			size:10240,
//			最多上传的数量
			number:20,
//			MultipartFile file 对应，layui默认就是file,要改动则相应改动
			field:'file',
			bindAction: '#demo3',
			before: function(obj) {
				//预读本地文件示例，不支持ie8
				obj.preview(function(index, file, result) {
					$('#demo2').append('<img src="' + result 
						+ '" alt="' + file.name 
						+'"height="92px" width="92px" class="layui-upload-img uploadImgPreView">')
				});
			},
			done: function(res, index, upload) {
				//每个图片上传结束的回调，成功的话，就把新图片的名字保存起来，作为数据提交
				console.log(res.code);
				if(res.code=="1"){
					fail++;
				}else{
					success++;
					imgurls=imgurls+""+res.data.src+",";
					$('#imgUrls').val(imgurls);
				}
			},
			allDone:function(obj){
			    layer.msg("总共要上传图片总数为："+(fail+success)+"\n"
			    			+"其中上传成功图片数为："+success+"\n"
			    			+"其中上传失败图片数为："+fail
			    		 )
			}
		});

	});
	
	//清空预览图片
	cleanImgsPreview();
	//保存商品
	imageSave();
});

/**
 * 清空预览的图片
 * 原因：如果已经存在预览的图片的话，再次点击上选择图片时，预览图片会不断累加
 * 表面上做上传成功的个数清0
 */
function cleanImgsPreview(){
	$("#cleanImgs").click(function(){
		success=0;
		fail=0;
		$('#demo2').html("");
		$('#imgUrls').val("");
	});
}

/**
 * 保存商品
 */
function imageSave(){
	$('#btnSubmit').click(function(){
		var tt=$("#title").val();
		var st=$("#smallTit").val();
		var ius=$("#imgUrls").val();
	
		$.ajax({
			   type: "POST",
			   url: "/saveGoods",
			   data: {
				   title:tt,
				   smallTit:st,
				   imgUrls:ius,
			   },
			   success: function(msg){
				   if(msg=="1"){
					   alert("保存成功");
				   }else{
					   alert("保存失败");
				   }
			   }
		});
	});
}

</script> -->
</html>